﻿<Window x:Class="openPDC.UI.Modal.ConfigurationCreator"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Configuration Creator" Height="360" Width="920"
        ShowInTaskbar="False" ResizeMode="NoResize"
         xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:uc="clr-namespace:GSF.TimeSeries.UI.UserControls;assembly=GSF.TimeSeries.UI.WPF"
             xmlns:tsfBinding="clr-namespace:GSF.TimeSeries.UI.Binding;assembly=GSF.TimeSeries.UI"
             Background="White">

    <Window.Resources>
            <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/GSF.TimeSeries.UI.WPF;Component/Resources/CommonResource.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    
    <Grid x:Name="GridDetailView" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="5" DataContext="{Binding Path=CurrentItem, Mode=TwoWay}"
          ShowGridLines="False">
        <Grid.BindingGroup >
            <BindingGroup Name="input"/>
        </Grid.BindingGroup>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid></Grid>
        <!--First Row-->
        <TextBlock Text="Device Detail" Grid.Row="0" Grid.Column="0"  HorizontalAlignment="Left" VerticalAlignment="Bottom" />
        <ListBox Name="listBoxDevices"  SelectedValuePath="@IDCode" SelectionChanged="listBoxDevices_SelectionChanged" SelectionMode="Extended" Grid.Row="1" Grid.RowSpan="6" Grid.Column="0"  HorizontalAlignment="Center" Width="150" Height="230" VerticalAlignment="Top" Background="{x:Null}"/>
        <!--Second Row-->
        <StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="1" Grid.RowSpan="6" VerticalAlignment="Top">
            <Button Content="Add" Name="buttonDeviceAdd" Click="buttonDeviceAdd_Click" HorizontalAlignment="Left" Width="80" />
            <Button Content="Copy" Name="buttonDeviceCopy" Click="buttonDeviceCopy_Click" HorizontalAlignment="Left" VerticalAlignment="Top" Width="80" />
            <Button Content="Delete" Name="buttonDeviceDelete" Click="buttonDeviceDelete_Click" HorizontalAlignment="Left"  VerticalAlignment="Top" Width="80" />
            <Button Content="Move Up"  Name="buttonDeviceMoveUp" Click="buttonDeviceMoveUp_Click" HorizontalAlignment="Left" VerticalAlignment="Top" Width="80" />
            <Button Content="Move Down" Name="buttonDeviceMoveDown" Click="buttonDeviceMoveDown_Click" HorizontalAlignment="Left" VerticalAlignment="Top" Width="80" />
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Analogs:" Width="47" HorizontalAlignment="Left"/>
                <TextBox Name="textBoxAnalogs" TextChanged="textBoxAnalogs_TextChanged" Text="0" PreviewKeyUp="textBoxAnalogs_PreviewKeyUp" Width="30" HorizontalAlignment="Right" />
            </StackPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                <TextBlock Text=" Digitals:" Width="47" HorizontalAlignment="Left"/>
                <TextBox Name="textBoxDigitals" TextChanged="textBoxDigitals_TextChanged" PreviewKeyUp="textBoxDigitals_PreviewKeyUp" Text="0" Width="30" HorizontalAlignment="Right"/>
            </StackPanel>            
        </StackPanel>
        <!--Third Row-->
      <StackPanel Orientation="Horizontal" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="1" >
            <Label Content="Device Name" Name="labelDeviceName" VerticalAlignment="Center" HorizontalAlignment="Right" Height="Auto"/>
            <TextBox Name="textBoxDeviceName" TextChanged="textBoxName_TextChanged" HorizontalAlignment="Left" Width="280"/>
      </StackPanel>
        
        <StackPanel Orientation="Horizontal" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="2">
            <Label Content="Device ID Code" Name="labelDeviceIDCode" VerticalAlignment="Center" HorizontalAlignment="Right" Height="Auto"/>
            <TextBox Name="textBoxDeviceIDCode" TextChanged="textBoxDeviceIDCode_TextChanged" PreviewKeyUp="textBoxDeviceIDCode_PreviewKeyUp" HorizontalAlignment="Left" Width="100"/>
        </StackPanel>
        
        <GroupBox Header="Phasor Coordinate Format" HorizontalAlignment="Center" Name="groupBoxPhasorCoordinateFormat" VerticalAlignment="Top" Grid.Column="2" Grid.Row="3" Grid.RowSpan="4" Width="175" >
            <StackPanel Orientation="Vertical">
                <RadioButton Content="Polar" GroupName="PhasorCoordinateFormat"  HorizontalAlignment="Left" Name="radioButtonPhasorPolar" VerticalAlignment="Top" IsChecked="True" Checked="radioButtonPhasorPolar_Checked"/>
                <RadioButton Content="Rectangular" GroupName="PhasorCoordinateFormat" HorizontalAlignment="Left" Name="radioButtonPhasorRectangular" VerticalAlignment="Bottom" Checked="radioButtonPhasorRectangular_Checked"/>
            </StackPanel>
        </GroupBox>
        <GroupBox Header="Phasor Data Format" HorizontalAlignment="Center" Name="groupBoxPhasorDataFormat" VerticalAlignment="Top" Grid.Column="2" Grid.Row="4" Width="175">
            <StackPanel Orientation="Vertical">
                <RadioButton Content="Floating Point" GroupName="PhasorDataFormat" Height="Auto" HorizontalAlignment="Left" Name="radioButtonPhasorFloatingPoint" VerticalAlignment="Top" IsChecked="True" Checked="radioButtonPhasorFloatingPoint_Checked" />
                <RadioButton Content="Scaled Integer" GroupName="PhasorDataFormat" Height="Auto" HorizontalAlignment="Left" Name="radioButtonPhasorScaledInteger" VerticalAlignment="Bottom" Checked="radioButtonPhasorScaledInteger_Checked" />
            </StackPanel>
        </GroupBox>
        <GroupBox Header="Frequency Data Format" HorizontalAlignment="Center" Name="groupBoxFrequencyDataFormat" VerticalAlignment="Top" Width="150" Grid.Column="3" Grid.Row="3">
            <StackPanel Orientation="Vertical">
                <RadioButton Content="Floating Point" GroupName="FrequencyDataFormat" Height="Auto" HorizontalAlignment="Left"  Name="radioButtonFrequencyFloatingPoint" VerticalAlignment="Top" IsChecked="True" Checked="radioButtonFrequencyFloatingPoint_Checked" />
                <RadioButton Content="Scaled Integer" GroupName="FrequencyDataFormat" Height="Auto" HorizontalAlignment="Left"  Name="radioButtonFrequencyScaledInteger" VerticalAlignment="Bottom" Checked="radioButtonFrequencyScaledInteger_Checked" />
            </StackPanel>
        </GroupBox>
        <GroupBox Header="Analog Data Format" HorizontalAlignment="Center" Name="groupBoxAnalogDataFormat" VerticalAlignment="Top" Width="150" Grid.Column="3" Grid.Row="4">
            <StackPanel Orientation="Vertical">
                <RadioButton Content="Floating Point" GroupName="AnalogDataFormat" Height="Auto" HorizontalAlignment="Left" Name="radioButtonAnalogFloatingPoint" VerticalAlignment="Top" IsChecked="True" Checked="radioButtonAnalogFloatingPoint_Checked" />
                <RadioButton Content="Scaled Integer" GroupName="AnalogDataFormat" Height="Auto" HorizontalAlignment="Left" Name="radioButtonAnalogScaledInteger" VerticalAlignment="Bottom" Checked="radioButtonAnalogScaledInteger_Checked"/>
            </StackPanel>
        </GroupBox>

        <!--Fourth Coloum-->
        <TextBlock Text="Phasor Detail" Grid.Row="0" Grid.Column="4" HorizontalAlignment="Left" />
        <ListBox Name="listBoxPhasors"  Grid.Row="1" Grid.RowSpan="4" Grid.Column="4" SelectionChanged="listBoxPhasors_SelectionChanged" SelectionMode="Extended" HorizontalAlignment="Center" VerticalAlignment="Top" Width="135" Height="150"/>

        <StackPanel Orientation="Vertical" HorizontalAlignment="Left" Grid.Column="4" Grid.Row="4" Grid.RowSpan="2">
            <StackPanel Orientation="Horizontal" >
                <TextBlock Text="Label:"  Width="50" HorizontalAlignment="Left"  VerticalAlignment="Center"/>
                <TextBox Name="textBoxPhasorLabel" TextChanged="textBoxPhasorLabel_TextChanged" Width="70" HorizontalAlignment="Right"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"  Grid.Column="4" Grid.Row="5">
              <TextBlock Text=" Scale:" Width="50" HorizontalAlignment="Left"/>
              <TextBox Name="textBoxPhasorScale"  TextChanged="textBoxPhasorScale_TextChanged" PreviewKeyUp="textBoxPhasorScale_PreviewKeyUp" Width="70" HorizontalAlignment="Right"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Column="4" Grid.Row="6">
              <TextBlock Text=" Offset:" Width="50" HorizontalAlignment="Left"/>
              <TextBox Name="textBoxPhasorOffset" TextChanged="textBoxPhasorOffset_TextChanged" PreviewKeyUp="textBoxPhasorOffset_PreviewKeyUp" Width="70" HorizontalAlignment="Right"/>
            </StackPanel>
        </StackPanel>
            <!--Sixth Coloum-->
        <StackPanel Orientation="Vertical" Grid.Column="5" Grid.Row="1" Grid.RowSpan="5" VerticalAlignment="Top" HorizontalAlignment="Left">
        <Button Content="Add" Name="buttonPhasorAdd" Click="buttonPhasorAdd_Click" HorizontalAlignment="Left" VerticalAlignment="Top" Width="80" />
        <Button Content="Copy" Name="buttonPhasorCopy" Click="buttonPhasorCopy_Click" HorizontalAlignment="Left" VerticalAlignment="Top" Width="80" />
        <Button Content="Delete" Name="buttonPhasorDelete" Click="buttonPhasorDelete_Click" HorizontalAlignment="Left"  VerticalAlignment="Top" Width="80" />
        <Button Content="Move Up" Name="buttonPhasorMoveUp" Click="buttonPhasorMoveUp_Click" HorizontalAlignment="Left" VerticalAlignment="Top" Width="80" />
        <Button Content="Move Down" Name="buttonPhasorMoveDown" Click="buttonPhasorMoveDown_Click" HorizontalAlignment="Left"  VerticalAlignment="Top" Width="80" />
        
        <GroupBox Header="Phasor Type" HorizontalAlignment="Left" Name="groupBoxPhasorType" VerticalAlignment="Top" Width="100">
            <StackPanel Orientation="Vertical"  >
                <RadioButton Content="Current" GroupName="PhasorType"  HorizontalAlignment="Left" IsChecked="True" Name="radioButtonPhasorTypeCurrent" VerticalAlignment="Top" Checked="radioButtonPhasorTypeCurrent_Checked"/>
                <RadioButton Content="Voltage" GroupName="PhasorType"  HorizontalAlignment="Left" Name="radioButtonPhasorTypeVoltage" VerticalAlignment="Bottom" Checked="radioButtonPhasorTypeVoltage_Checked" />
            </StackPanel>
        </GroupBox>
        </StackPanel>
            <!--Eight Row-->
        <StackPanel Orientation="Horizontal" Grid.Column="4"  Grid.ColumnSpan="5" Grid.Row="8" HorizontalAlignment="Right" >
            <Button x:Name="ButtonClear" Content="Cancel" Click="ButtonClear_Click"/>
            <Button x:Name="ButtonSave" Content="Save" Click="ButtonSave_Click"/>
        </StackPanel>
    </Grid>
    
</Window>